﻿'
' Will Strohl (will.strohl@gmail.com)
' http://www.willstrohl.com
'
'Copyright (c) 2011, Will Strohl
'All rights reserved.
'
'Redistribution and use in source and binary forms, with or without modification, are 
'permitted provided that the following conditions are met:
'
'Redistributions of source code must retain the above copyright notice, this list of 
'conditions and the following disclaimer.
'
'Redistributions in binary form must reproduce the above copyright notice, this list 
'of conditions and the following disclaimer in the documentation and/or other 
'materials provided with the distribution.
'
'Neither the name of Will Strohl nor the names of its contributors may be 
'used to endorse or promote products derived from this software without specific prior 
'written permission.
'
'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
'EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
'OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
'SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
'INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
'TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
'BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
'CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
'ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
'DAMAGE.
'

Imports System.Collections.Generic
Imports System.Text

Namespace WillStrohl.Modules.CodeCamp

    Public NotInheritable Class CodeCampController
        'Implements IPortable

#Region " Constants "

        Public Const JSON_PROPERTY_FORMAT As String = "'{0}' : {1},"
        Public Const JSON_PROPERTY_FORMAT_END As String = "'{0}' : {1}"
        Public Const JSON_BRACKET_OPEN As String = "{"
        Public Const JSON_OPEN As String = "{0}:["
        Public Const JSON_FORMAT_COMMA As String = "'{0}',"
        Public Const JSON_FORMAT As String = "'{0}'"
        Public Const JSON_CLOSE As String = "] }"
        Public Const JSON_BRACKET_CLOSE As String = "}"

#End Region

#Region " Data Access "

#Region " CodeCamp "

        Public Function AddCodeCamp(ByVal ModuleId As Integer, ByVal Title As String, ByVal Description As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal IconFile As String, ByVal AltText As String, ByVal RoleName As String, ByVal WaitListRoleName As String, ByVal MaximumCapacity As Integer, ByVal RegistrationActive As Boolean, ByVal ShowShirtSize As Boolean, ByVal ShowMicrosoftMVP As Boolean, ByVal ShowAuthor As Boolean, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddCodeCamp(ModuleId, Title, Description, BeginDate, EndDate, IconFile, AltText, RoleName, WaitListRoleName, MaximumCapacity, RegistrationActive, ShowShirtSize, ShowMicrosoftMVP, ShowAuthor, CreatedByUser)
        End Function
        Public Sub UpdateCodeCamp(ByVal CodeCampId As Integer, ByVal ModuleId As Integer, ByVal Title As String, ByVal Description As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal IconFile As String, ByVal AltText As String, ByVal RoleName As String, ByVal WaitListRoleName As String, ByVal MaximumCapacity As Integer, ByVal NumberRegistered As Integer, ByVal EventFull As Boolean, ByVal RegistrationActive As Boolean, ByVal ShowShirtSize As Boolean, ByVal ShowMicrosoftMVP As Boolean, ByVal ShowAuthor As Boolean, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateCodeCamp(CodeCampId, ModuleId, Title, Description, BeginDate, EndDate, IconFile, AltText, RoleName, WaitListRoleName, MaximumCapacity, NumberRegistered, EventFull, RegistrationActive, ShowShirtSize, ShowMicrosoftMVP, ShowAuthor, CreatedByUser)
        End Sub
        Public Sub DeleteCodeCamp(ByVal CodeCampId As Integer)
            DataProvider.Instance().DeleteCodeCamp(CodeCampId)
        End Sub
        Public Function GetCodeCampById(ByVal CodeCampId As Integer) As CodeCampInfo
            Dim objCodeCamp As New CodeCampInfo
            objCodeCamp.Fill(DataProvider.Instance().GetCodeCampById(CodeCampId))

            If Not objCodeCamp Is Nothing AndAlso objCodeCamp.CodeCampId > 0 Then
                Return objCodeCamp
            Else
                Return Nothing
            End If
        End Function
        Public Function GetCodeCampByModule(ByVal ModuleId As Integer) As CodeCampInfo
            Dim objCodeCamp As New CodeCampInfo
            objCodeCamp.Fill(DataProvider.Instance().GetCodeCampByModule(ModuleId))

            If Not objCodeCamp Is Nothing AndAlso objCodeCamp.CodeCampId > 0 Then
                Return objCodeCamp
            Else
                Return Nothing
            End If
        End Function
        Public Function GetCodeCamps() As CodeCampInfoCollection
            Dim collCodeCamp As New CodeCampInfoCollection
            collCodeCamp.Fill(DataProvider.Instance().GetCodeCamps)

            If Not collCodeCamp Is Nothing AndAlso collCodeCamp.Count > 0 Then
                Return collCodeCamp
            Else
                Return Nothing
            End If
        End Function
        Public Function GetCodeCampsFutureSorted() As CodeCampInfoCollection
            Dim collCodeCamp As New CodeCampInfoCollection
            collCodeCamp.Fill(DataProvider.Instance().GetCodeCampsFutureSorted)

            If Not collCodeCamp Is Nothing AndAlso collCodeCamp.Count > 0 Then
                Return collCodeCamp
            Else
                Return Nothing
            End If
        End Function
        Public Sub EnableCodeCamp(ByVal CodeCampId As Integer, ByVal Enable As Boolean)
            DataProvider.Instance().EnableCodeCamp(CodeCampId, Enable)
        End Sub

#End Region

#Region " Registration "

        Public Function AddRegistration(ByVal CodeCampId As Integer, ByVal UserId As Integer, ByVal ShirtSize As String) As Integer
            Return DataProvider.Instance().AddRegistration(CodeCampId, UserId, ShirtSize)
        End Function
        Public Sub UpdateRegistration(ByVal RegistrationId As Integer, ByVal CodeCampId As Integer, ByVal UserId As Integer, ByVal ShirtSize As String)
            DataProvider.Instance().UpdateRegistration(RegistrationId, CodeCampId, UserId, ShirtSize)
        End Sub
        Public Sub DeleteRegistration(ByVal RegistrationId As Integer)
            DataProvider.Instance().DeleteRegistration(RegistrationId)
        End Sub
        Public Function GetRegistrationById(ByVal RegistrationId As Integer) As RegistrationInfo
            Dim objRegistration As New RegistrationInfo
            objRegistration.Fill(DataProvider.Instance().GetRegistrationById(RegistrationId))

            If Not objRegistration Is Nothing AndAlso objRegistration.RegistrationId > 0 Then
                Return objRegistration
            Else
                Return Nothing
            End If
        End Function
        Public Function GetRegistrationByUser(ByVal UserId As Integer) As RegistrationInfo
            Dim objRegistration As New RegistrationInfo
            objRegistration.Fill(DataProvider.Instance().GetRegistrationByUser(UserId))

            If Not objRegistration Is Nothing AndAlso objRegistration.RegistrationId > 0 Then
                Return objRegistration
            Else
                Return Nothing
            End If
        End Function
        Public Function GetRegistrations(ByVal CodeCampId As Integer) As RegistrationInfoCollection
            Dim collRegistration As New RegistrationInfoCollection
            collRegistration.Fill(DataProvider.Instance().GetRegistrations(CodeCampId))

            If Not collRegistration Is Nothing AndAlso collRegistration.Count > 0 Then
                Return collRegistration
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " Volunteer "

        Public Function AddVolunteer(ByVal RegistrationId As Integer, ByVal Notes As String) As Integer
            Return DataProvider.Instance().AddVolunteer(RegistrationId, Notes)
        End Function
        Public Sub UpdateVolunteer(ByVal VolunteerId As Integer, ByVal RegistrationId As Integer, ByVal Notes As String)
            DataProvider.Instance().UpdateVolunteer(VolunteerId, RegistrationId, Notes)
        End Sub
        Public Sub DeleteVolunteer(ByVal VolunteerId As Integer)
            DataProvider.Instance().DeleteVolunteer(VolunteerId)
        End Sub
        Public Function GetVolunteer(ByVal VolunteerId As Integer) As VolunteerInfo
            Dim objVolunteer As New VolunteerInfo
            objVolunteer.Fill(DataProvider.Instance().GetVolunteer(VolunteerId))

            If Not objVolunteer Is Nothing AndAlso objVolunteer.VolunteerId > 0 Then
                Return objVolunteer
            Else
                Return Nothing
            End If
        End Function
        Public Function GetVolunteers(ByVal CodeCampId As Integer) As VolunteerInfoCollection
            Dim collVolunteer As New VolunteerInfoCollection
            collVolunteer.Fill(DataProvider.Instance().GetVolunteers(CodeCampId))

            If Not collVolunteer Is Nothing AndAlso collVolunteer.Count > 0 Then
                Return collVolunteer
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " VolunteerTask "

        Public Function AddVolunteerTask(ByVal VolunteerId As Integer, ByVal Title As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddVolunteerTask(VolunteerId, Title, BeginDate, EndDate, CreatedByUser)
        End Function
        Public Sub UpdateVolunteerTask(ByVal VolunteerTaskId As Integer, ByVal VolunteerId As Integer, ByVal Title As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateVolunteerTask(VolunteerTaskId, VolunteerId, Title, BeginDate, EndDate, CreatedByUser)
        End Sub
        Public Sub DeleteVolunteerTask(ByVal VolunteerTaskId As Integer)
            DataProvider.Instance().DeleteVolunteerTask(VolunteerTaskId)
        End Sub
        Public Function GetVolunteerTask(ByVal VolunteerTaskId As Integer) As VolunteerTaskInfo
            Dim objVolunteerTask As New VolunteerTaskInfo
            objVolunteerTask.Fill(DataProvider.Instance().GetVolunteerTask(VolunteerTaskId))

            If Not objVolunteerTask Is Nothing AndAlso objVolunteerTask.VolunteerTaskId > 0 Then
                Return objVolunteerTask
            Else
                Return Nothing
            End If
        End Function
        Public Function GetVolunteerTasks(ByVal VolunteerId As Integer) As VolunteerTaskInfoCollection
            Dim collVolunteerTask As New VolunteerTaskInfoCollection
            collVolunteerTask.Fill(DataProvider.Instance().GetVolunteerTasks(VolunteerId))

            If Not collVolunteerTask Is Nothing AndAlso collVolunteerTask.Count > 0 Then
                Return collVolunteerTask
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " TimeSlot "

        Public Function AddTimeSlot(ByVal CodeCampId As Integer, ByVal BeginTime As DateTime, ByVal EndTime As DateTime, ByVal AgendaText As String, ByVal SpanAllTracks As Boolean, ByVal IncludeInDropDowns As Boolean, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddTimeSlot(CodeCampId, BeginTime, EndTime, AgendaText, SpanAllTracks, IncludeInDropDowns, CreatedByUser)
        End Function
        Public Sub UpdateTimeSlot(ByVal TimeSlotId As Integer, ByVal CodeCampId As Integer, ByVal BeginTime As DateTime, ByVal EndTime As DateTime, ByVal AgendaText As String, ByVal SpanAllTracks As Boolean, ByVal IncludeInDropDowns As Boolean, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateTimeSlot(TimeSlotId, CodeCampId, BeginTime, EndTime, AgendaText, SpanAllTracks, IncludeInDropDowns, CreatedByUser)
        End Sub
        Public Sub DeleteTimeSlot(ByVal TimeSlotId As Integer)
            DataProvider.Instance().DeleteTimeSlot(TimeSlotId)
        End Sub
        Public Function GetTimeSlot(ByVal TimeSlotId As Integer) As TimeSlotInfo
            Dim objTimeSlot As New TimeSlotInfo
            objTimeSlot.Fill(DataProvider.Instance().GetTimeSlot(TimeSlotId))

            If Not objTimeSlot Is Nothing AndAlso objTimeSlot.TimeSlotId > 0 Then
                Return objTimeSlot
            Else
                Return Nothing
            End If
        End Function
        Public Function GetTimeSlots(ByVal CodeCampId As Integer) As TimeSlotInfoCollection
            Dim collTimeSlot As New TimeSlotInfoCollection
            collTimeSlot.Fill(DataProvider.Instance().GetTimeSlots(CodeCampId))

            If Not collTimeSlot Is Nothing AndAlso collTimeSlot.Count > 0 Then
                Return collTimeSlot
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " Speaker "

        Public Function AddSpeaker(ByVal RegistrationId As Integer, ByVal SpeakerName As String, ByVal CompanyTitle As String, ByVal CompanyName As String, ByVal URL As String, ByVal Bio As String, ByVal IconFile As String, ByVal MicrosoftMVP As Boolean, ByVal Author As Boolean, ByVal Approved As Boolean, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddSpeaker(RegistrationId, SpeakerName, CompanyTitle, CompanyName, URL, Bio, IconFile, MicrosoftMVP, Author, Approved, CreatedByUser)
        End Function
        Public Sub UpdateSpeaker(ByVal SpeakerId As Integer, ByVal RegistrationId As Integer, ByVal SpeakerName As String, ByVal CompanyTitle As String, ByVal CompanyName As String, ByVal URL As String, ByVal Bio As String, ByVal IconFile As String, ByVal MicrosoftMVP As Boolean, ByVal Author As Boolean, ByVal Approved As Boolean, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateSpeaker(SpeakerId, RegistrationId, SpeakerName, CompanyTitle, CompanyName, URL, Bio, IconFile, MicrosoftMVP, Author, Approved, CreatedByUser)
        End Sub
        Public Sub DeleteSpeaker(ByVal SpeakerId As Integer)
            DataProvider.Instance().DeleteSpeaker(SpeakerId)
        End Sub
        Public Function GetSpeaker(ByVal SpeakerId As Integer) As SpeakerInfo
            Dim objSpeaker As New SpeakerInfo
            objSpeaker.Fill(DataProvider.Instance().GetSpeaker(SpeakerId))

            If Not objSpeaker Is Nothing AndAlso objSpeaker.SpeakerId > 0 Then
                Return objSpeaker
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSpeakerByUserId(ByVal UserId As Integer) As SpeakerInfo
            Dim objSpeaker As New SpeakerInfo
            objSpeaker.Fill(DataProvider.Instance().GetSpeakerByUserId(UserId))

            If Not objSpeaker Is Nothing AndAlso objSpeaker.SpeakerId > 0 Then
                Return objSpeaker
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSpeakerByRegistrationId(ByVal RegistrationId As Integer) As SpeakerInfo
            Dim objSpeaker As New SpeakerInfo
            objSpeaker.Fill(DataProvider.Instance().GetSpeakerByRegistrationId(RegistrationId))

            If Not objSpeaker Is Nothing AndAlso objSpeaker.SpeakerId > 0 Then
                Return objSpeaker
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSpeakersBySession(ByVal SessionId As Integer) As SpeakerInfoCollection
            Dim collSpeaker As New SpeakerInfoCollection
            collSpeaker.Fill(DataProvider.Instance().GetSpeakersBySession(SessionId))

            If Not collSpeaker Is Nothing AndAlso collSpeaker.Count > 0 Then
                Return collSpeaker
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSpeakersByCodeCamp(ByVal CodeCampId As Integer) As SpeakerInfoCollection
            Dim collSpeaker As New SpeakerInfoCollection
            collSpeaker.Fill(DataProvider.Instance().GetSpeakersByCodeCamp(CodeCampId))

            If Not collSpeaker Is Nothing AndAlso collSpeaker.Count > 0 Then
                Return collSpeaker
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSpeakersByCodeCampAll(ByVal CodeCampId As Integer) As SpeakerInfoCollection
            Dim collSpeaker As New SpeakerInfoCollection
            collSpeaker.Fill(DataProvider.Instance().GetSpeakersByCodeCampAll(CodeCampId))

            If Not collSpeaker Is Nothing AndAlso collSpeaker.Count > 0 Then
                Return collSpeaker
            Else
                Return Nothing
            End If
        End Function
        Public Sub ApproveSpeaker(ByVal SpeakerId As Integer, ByVal Approved As Boolean)
            DataProvider.Instance().ApproveSpeaker(SpeakerId, Approved)
        End Sub

#End Region

#Region " Track "

        Public Function AddTrack(ByVal CodeCampId As Integer, ByVal Title As String, ByVal Description As String, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddTrack(CodeCampId, Title, Description, CreatedByUser)
        End Function
        Public Sub UpdateTrack(ByVal TrackId As Integer, ByVal CodeCampId As Integer, ByVal Title As String, ByVal Description As String, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateTrack(TrackId, CodeCampId, Title, Description, CreatedByUser)
        End Sub
        Public Sub DeleteTrack(ByVal TrackId As Integer)
            DataProvider.Instance().DeleteTrack(TrackId)
        End Sub
        Public Function GetTrack(ByVal TrackId As Integer) As TrackInfo
            Dim objTrack As New TrackInfo
            objTrack.Fill(DataProvider.Instance().GetTrack(TrackId))

            If Not objTrack Is Nothing AndAlso objTrack.TrackId > 0 Then
                Return objTrack
            Else
                Return Nothing
            End If
        End Function
        Public Function GetTracks(ByVal CodeCampId As Integer) As TrackInfoCollection
            Dim collTrack As New TrackInfoCollection
            collTrack.Fill(DataProvider.Instance().GetTracks(CodeCampId))

            If Not collTrack Is Nothing AndAlso collTrack.Count > 0 Then
                Return collTrack
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " Session "

        Public Overloads Function AddSession(ByVal SpeakerId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddSessionMinimal(SpeakerId, Title, Description, AudienceLevel, CreatedByUser)
        End Function
        Public Overloads Function AddSession(ByVal SpeakerId As Integer, ByVal TrackId As Integer, ByVal TimeSlotId As Integer, ByVal RoomId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddSession(SpeakerId, TrackId, TimeSlotId, RoomId, Title, Description, AudienceLevel, CreatedByUser)
        End Function
        Public Overloads Sub UpdateSession(ByVal SessionId As Integer, ByVal SpeakerId As Integer, ByVal TrackId As Integer, ByVal TimeSlotId As Integer, ByVal RoomId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateSession(SessionId, SpeakerId, TrackId, TimeSlotId, RoomId, Title, Description, AudienceLevel, CreatedByUser)
        End Sub
        Public Overloads Sub UpdateSession(ByVal SessionId As Integer, ByVal SpeakerId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateSessionMinimal(SessionId, SpeakerId, Title, Description, AudienceLevel, CreatedByUser)
        End Sub
        Public Sub DeleteSession(ByVal SessionId As Integer)
            DataProvider.Instance().DeleteSession(SessionId)
        End Sub
        Public Function GetSession(ByVal SessionId As Integer) As SessionInfo
            Dim objSession As New SessionInfo
            objSession.Fill(DataProvider.Instance().GetSession(SessionId))

            If Not objSession Is Nothing AndAlso objSession.SessionId > 0 Then
                Return objSession
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSessionsBySpeakerId(ByVal SpeakerId As Integer) As SessionInfoCollection
            Dim collSession As New SessionInfoCollection
            collSession.Fill(DataProvider.Instance().GetSessionsBySpeakerId(SpeakerId))

            If Not collSession Is Nothing AndAlso collSession.Count > 0 Then
                Return collSession
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSessionsByTrack(ByVal TrackId As Integer) As SessionInfoCollection
            Dim collSession As New SessionInfoCollection
            collSession.Fill(DataProvider.Instance().GetSessionsByTrack(TrackId))

            If Not collSession Is Nothing AndAlso collSession.Count > 0 Then
                Return collSession
            Else
                Return Nothing
            End If
        End Function
        Public Function GetSessionsByCodeCamp(ByVal CodeCampId As Integer) As SessionInfoCollection
            Dim collSession As New SessionInfoCollection
            collSession.Fill(DataProvider.Instance().GetSessionsByCodeCamp(CodeCampId))

            If Not collSession Is Nothing AndAlso collSession.Count > 0 Then
                Return collSession
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " Room "

        Public Function AddRoom(ByVal CodeCampId As Integer, ByVal RoomName As String, ByVal Description As String, ByVal MaximumCapacity As Integer, ByVal CreatedByUser As Integer) As Integer
            Return DataProvider.Instance().AddRoom(CodeCampId, RoomName, Description, MaximumCapacity, CreatedByUser)
        End Function
        Public Sub UpdateRoom(ByVal RoomId As Integer, ByVal CodeCampId As Integer, ByVal RoomName As String, ByVal Description As String, ByVal MaximumCapacity As Integer, ByVal CreatedByUser As Integer)
            DataProvider.Instance().UpdateRoom(RoomId, CodeCampId, RoomName, Description, MaximumCapacity, CreatedByUser)
        End Sub
        Public Sub DeleteRoom(ByVal RoomId As Integer)
            DataProvider.Instance().DeleteRoom(RoomId)
        End Sub
        Public Function GetRoom(ByVal RoomId As Integer) As RoomInfo
            Dim objRoom As New RoomInfo
            objRoom.Fill(DataProvider.Instance().GetRoom(RoomId))

            If Not objRoom Is Nothing AndAlso objRoom.RoomId > 0 Then
                Return objRoom
            Else
                Return Nothing
            End If
        End Function
        Public Function GetRoomsByCodeCamp(ByVal CodeCampId As Integer) As RoomInfoCollection
            Dim collRoom As New RoomInfoCollection
            collRoom.Fill(DataProvider.Instance().GetRoomsByCodeCamp(CodeCampId))

            If Not collRoom Is Nothing AndAlso collRoom.Count > 0 Then
                Return collRoom
            Else
                Return Nothing
            End If
        End Function

#End Region

#Region " Get Object Counts "

        Public Function CodeCampCount() As Integer
            Return DataProvider.Instance().CodeCampCount()
        End Function
        Public Function CodeCampAttendeeCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().CodeCampAttendeeCount(CodeCampId)
        End Function
        Public Function CodeCampRoomCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().CodeCampRoomCount(CodeCampId)
        End Function
        Public Function CodeCampSessionCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().CodeCampSessionCount(CodeCampId)
        End Function
        Public Function CodeCampSpeakerCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().CodeCampSpeakerCount(CodeCampId)
        End Function
        Public Function CodeCampTrackCount(ByVal CodeCampId As Integer) As Integer
            Dim intReturn As Integer = DataProvider.Instance().CodeCampTrackCount(CodeCampId)
            Trace.TraceWarning("CodeCampController: intReturn = " & intReturn)
            Return intReturn
        End Function
        Public Function CodeCampVolunteerCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().CodeCampVolunteerCount(CodeCampId)
        End Function
        Public Function CodeCampVolunteerTaskCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().CodeCampVolunteerTaskCount(CodeCampId)
        End Function
        Public Function SpeakerSessionCount(ByVal CodeCampId As Integer) As Integer
            Return DataProvider.Instance().SpeakerSessionCount(CodeCampId)
        End Function
        Public Function TrackSessionCount(ByVal TrackId As Integer) As Integer
            Return DataProvider.Instance().TrackSessionCount(TrackId)
        End Function

#End Region

#End Region

        Public Overloads Shared Function GenerateJSON(ByVal CollectionName As String, ByVal Coll As List(Of String)) As String

            Dim intCount As Integer = 0
            Dim sb As New StringBuilder(100)
            sb.Append(JSON_BRACKET_OPEN)
            sb.AppendFormat(JSON_OPEN, CollectionName)

            For Each obj As String In Coll
                If Coll(intCount).Contains("'") Then
                    Coll(intCount).Replace("'", "\'")
                End If
                If intCount < Coll.Count - 1 Then
                    sb.AppendFormat(JSON_FORMAT_COMMA, Coll(intCount))
                Else
                    sb.AppendFormat(JSON_FORMAT, Coll(intCount))
                End If
                intCount += 1
            Next

            sb.Append(JSON_CLOSE)

            Return sb.ToString

        End Function

#Region " IPortable Implementation "

        'Public Function ExportModule(ByVal ModuleID As Integer) As String Implements DotNetNuke.Entities.Modules.IPortable.ExportModule
        '    Dim sb As New StringBuilder(150)
        '    Dim collInj As New LightboxInfoCollection
        '    collInj = GetLightboxes(ModuleID)

        '    sb.Append("<WillStrohl><Lightboxes>")
        '    For Each obj As LightboxInfo In collInj
        '        sb.Append("<Lightbox>")
        '        sb.AppendFormat("<LightboxId>{0}</LightboxId>", obj.LightboxId)
        '        sb.AppendFormat("<ModuleId>{0}</ModuleId>", obj.ModuleId)
        '        sb.AppendFormat("<GalleryName>{0}</GalleryName>", XmlUtils.XMLEncode(obj.GalleryName))
        '        sb.AppendFormat("<GalleryDescription>{0}</GalleryDescription>", XmlUtils.XMLEncode(obj.GalleryDescription))
        '        sb.AppendFormat("<GalleryFolder>{0}</GalleryFolder>", XmlUtils.XMLEncode(obj.GalleryFolder))
        '        sb.AppendFormat("<ShowDownloadLink>{0}</ShowDownloadLink>", obj.ShowDownloadLink)
        '        sb.AppendFormat("<SupportIE6>{0}</SupportIE6>", obj.SupportIE6)
        '        sb.AppendFormat("<ShowUpgradeIE6>{0}</ShowUpgradeIE6>", obj.ShowUpgradeIE6)
        '        sb.AppendFormat("<TransitionSpeed>{0}</TransitionSpeed>", obj.TransitionSpeed)
        '        sb.Append("</Lightbox>")
        '    Next
        '    sb.Append("</Lightboxes>")
        '    ' later on, will probably need to add module settings here
        '    sb.Append("</WillStrohl>")

        '    Return sb.ToString
        'End Function

        'Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserID As Integer) Implements DotNetNuke.Entities.Modules.IPortable.ImportModule
        '    Dim injContents As XmlNode = DotNetNuke.Common.Globals.GetContent(Content, "Lightboxes")

        '    For Each injContent As XmlNode In injContents.SelectNodes("Lightbox")
        '        Dim objInj As New LightboxInfo
        '        objInj.ModuleId = ModuleID
        '        objInj.GalleryName = injContent.SelectSingleNode("GalleryName").InnerText
        '        objInj.GalleryDescription = injContent.SelectSingleNode("GalleryDescription").InnerText
        '        objInj.GalleryFolder = injContent.SelectSingleNode("GalleryFolder").InnerText
        '        objInj.ShowDownloadLink = Boolean.Parse(injContent.SelectSingleNode("ShowDownloadLink").InnerText)
        '        objInj.SupportIE6 = Boolean.Parse(injContent.SelectSingleNode("SupportIE6").InnerText)
        '        objInj.ShowUpgradeIE6 = Boolean.Parse(injContent.SelectSingleNode("ShowUpgradeIE6").InnerText)
        '        objInj.TransitionSpeed = Integer.Parse(injContent.SelectSingleNode("TransitionSpeed").InnerText, Globalization.NumberStyles.Integer)
        '        AddLightbox(objInj)
        '    Next

        'End Sub

#End Region

    End Class

End Namespace